package com.devunion.reader.server.mediator;

import com.devunion.bogdan.model.project.Paper;
import com.devunion.reader.client.to.PaperTo;

/**
 * @author Timoshenko Alexander 28.05.2009 : 10:59:47
 */
public class PaperMediator implements IMediator<Paper, PaperTo> {
    private PaperInfoMediator paperInfoMediator;

    public void setPaperInfoMediator(PaperInfoMediator paperInfoMediator) {
        this.paperInfoMediator = paperInfoMediator;
    }

    public PaperTo copyFromEntity(Paper anEntity) {
        PaperTo theTo = new PaperTo();
        theTo.setId(anEntity.getPaperId());
        theTo.setPaperInfoTo(paperInfoMediator.copyFromEntity(anEntity.getInfo()));

        return theTo;
    }
}
